package cn.edu.cug.cs.gtl.plugins.htsfile.actions;

import cn.edu.cug.cs.gtl.apis.ui.AbstractApplication;
import cn.edu.cug.cs.gtl.apis.ui.actions.AbstractAction;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.Locale;
import java.util.ResourceBundle;

public class OpenHTSFileAction extends AbstractAction {
    @Override
    public void initialize(AbstractApplication theApp) {
        ResourceBundle resourceBundle = ResourceBundle.getBundle("htsfile-resource", Locale.getDefault());
        name=resourceBundle.getString("menu.file.open_hts_file");
        menuItem.setText(name);
        this.theApp = theApp;
        menuItem.addActionListener(this);
        theApp.getMainFrame().getFileMenu().add(menuItem);
    }

    /**
     * Invoked when an action occurs.
     *
     * @param e the event to be processed
     */
    @Override
    public void actionPerformed(ActionEvent e) {

        JDialog dialog =new JDialog(theApp.getMainFrame(),"OpenHTSFileAction",true);

        dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);

        dialog.setSize(200, 100);

        dialog.setVisible(true);
    }
}
